package method;

public class ArrayAlg {

    public static <T> T getMiddle(T[] a) {
        return a[a.length / 2];
    }

    public static void main(String[] args) {
        String[] names = { "Marry", "Tom", "Bob" };
        Integer[] scores = { 90, 80, 70 };

        System.out.println(ArrayAlg.<Integer>getMiddle(scores));
        System.out.println(ArrayAlg.<String>getMiddle(names));
    }
}
